﻿using System;
using System.Collections.Generic;
using System.Linq;
using ALC.Core.ViewModels.Workpiece;
using HalconDotNet;

namespace ALC.Core.Helpers
{
    public static class Misc
    {
        public static IList<FaiItem> Clone(this IList<FaiItem> faiItemsIn) =>
            faiItemsIn.Select(item => item.Clone()).ToList();

        public static float ToFloat(this WorkpieceResult result)
        {
            throw new NotImplementedException();
        } 
        
        public static HImage HobjectToHImage(this HObject hobject)
        {
            HTuple pointer, type, width, height;
            HImage output = new HImage();
            HOperatorSet.GetImagePointer1(hobject, out pointer, out type, out width, out height);
            output.GenImage1(type, width, height, pointer);

            return output;
        }
    }
    
    

}